package com.nbufe.strategy.demo2;

/**
 * @Author Zan
 * @Create 2024/5/20 8:12
 * @ClassName: TouristParty
 * @Description : TODO 请用一句话描述该类的功能
 */
public class TouristParty {

    private TravelStrategy travelStrategy;

    private double price;

    public TouristParty(TravelStrategy travelStrategy) {
        this.travelStrategy = travelStrategy;
    }

    public double getPrice() {
        return price;
    }

    /**
     * 计算费用
     * @param nums 车辆数
     * @param hours 租的时间
     */
    public void travelFee(int nums, int hours) {
        price += travelStrategy.calculate(nums, hours);
    }

    public void travelFee() {
        price += travelStrategy.calculate();
    }
}
